﻿var NumberRange = {
    model: "",
    component: {
        name: "NumberRange",
        data: {
            props: {
                items: {
                    type: Array,
                    default: []
                },
                value: {
                    type: [String, Array],
                    default: [0, 0]
                },
                data: {
                    type: Object,
                    default: {}
                },
                //0填写 1查看
                renderType: {
                    type: Number,
                    default: 0
                }
            },
            methods: {
                setValue: function (index, value) {
                    var arr = this.value;
                    arr[index] = value;
                    this.$emit("update:value", arr);
                }
            },
            template: `
					   <div :class="['lg-form-item','lg-form-fa-item',{'lg-ver-error':data.error},{'pointer-none':renderType==1}]" :style="{'width':data.Width}">
						    <div class="lg-form-block">
						    <div class="lg-form-title">
							   <div class="lg-form-title-item">
                                 <i v-if="data.Required">*</i>
			                     <span class="cn">{{data.Title}}</span>
                                 <span class="en">{{data.EnTitle}}</span>
			                   </div>	
							</div>
							<div class="lg-form-control">
							     <div class="lg-form-control  lg-form-mark lg-form-flex">
									<div class="lg-inline lg-inline-100">
										<span class="lg-form-mark-icon">起</span>
										<input maxlength="400" class="lg-input lg-input-text lg-input-small" :value="value[0]" v-on:change="setValue(0,$event.target.value)">
									</div>
									<div class="lg-inline lg-inline-100">
										<span class="lg-form-mark-icon">止</span>
										<input maxlength="400" class="lg-input lg-input-text lg-input-small" :value="value[1]" v-on:change="setValue(1,$event.target.value)">
									</div>
								</div>
 							</div>
						  </div>
						  <div class="lg-form-block">
						    <div class="lg-form-tip"><p>{{data.Tips}}</p></div>
						    <div class="lg-form-ver" v-if="data.error">{{data.errMsg}}</div>
						  </div>
						</div>`
        }
    }
}
